home *** CD-ROM | disk | FTP | other *** search
- Path: informatik.tu-muenchen.de!fischerj
- From: fischerj@informatik.tu-muenchen.de (Juergen "Rally" Fischer)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: TMapping again!
- Date: 15 Feb 1996 17:29:10 GMT
- Organization: Technische Universitaet Muenchen, Germany
- Distribution: world
- Message-ID: <4fvqh6$na2@sunsystem5.informatik.tu-muenchen.de>
- References: <38232371@kone.fipnet.fi> <4fntd3$g56@sunsystem5.informatik.tu-muenchen.de> <38232442@kone.fipnet.fi>
- NNTP-Posting-Host: hphalle5.informatik.tu-muenchen.de
- Originator: fischerj@hphalle5.informatik.tu-muenchen.de
-
-
- In article <38232442@kone.fipnet.fi>, "Jyrki Saarinen" <jsaarinen@kone.fipnet.fi> writes:
- |>
- |> > A ultraoptimized texturemapper uese no shading table.
- |> > even add-shading slows mapping down.
- |> >
- |> > Imgagine 32 colors, each 8 shading-steps = 256 colors.
- |>
- |> Yep. But how do you expect that a game for example can
- |> be made with n-1 textures, all sharing the same 32c palette?
-
- n-1 ? my computer runs 15-1 MHz :)
- well, I guess a good gfx-man can do various textures with
- 32 colors. no scanned pictures of course ;)
-
- |>
- |> > move.w d1,d6
- |> > move.b d0,d6
- |> > move.l d6,a0
- |> > move.b (a0),d7
- |> > sub.b d5,d7 ;another 2 cycles
- |> > move.b d7,(a1)+ ;another 2 cycles
- |> >
- |> > addx.l d2,d0 ;x
- |> > addx.l d3,d1 ;y
- |> > addx.l d4,d5 ;gouraud-alike color. ;another 2 cycles
- |>
- |> Your sub.b d5,d7 trashs the X-flag .. better use or.b.
-
- hehe, you got me, you see I never tested it.
- thanks for the hint.
-
- |>
- |> > no reg left for dbra loop. 2 more cycles in unrolled loop.
- |> >
- |> > in inner-loop another 6 additional cycles compared to
- |> > nonshaded mapping. +30%.
- |>
- |> Hmm. I made once a mapper with 16c and 16 shades, all fitted
- |> to registers, add.l an,ax was used for V interpolation though,
- |> only 8 bits of fraction in V.
- |>
- |> > I guess with table it's more like +70%.
- |>
- |> Well. How many cycles the optimal mapper was?
- |>
- |> move.w d1,d0
- |> move.b d2,d0
- |> addx.l d3,d1
- |> move.l d0,a0
- |> addx.l d4,d2
- |> move.b (a0),(a1)+
- |>
- |> That is 17 cycles .. now, my Texture/Gouraud loop with
- |> a shading table, 256c and up to 256 shades is 30 020/030
- |> cycles, calculated the same way like that 17 cycles.
- |>
- |> ~76% slower .. Quite a good guess.
- |>
- |> But who cares, you wont do a game without any shading.
-
- using much mem you can precalc the walls. and coppershade
- the floors (which are done with the 32x32 11cycle-mapper ;)
-
- |>
- |> > But maybe with using a special palette-setup you
- |> > can do tricks.
- |>
- |> What kind of tricks .. I dont see a many of them.
-
- argh the trick would need add or sub I guess :\
- And the trick probable would not be able to shade
- down to black...
-
- imagine 32 colors going from yellow to dark red.
- color 31 would mean yellow, to shade sutract from 0 to 7.
- color 30 would be a less bright yellow, also available
- for the original texture. also sub 0-7.
- color 7 would be last available color, sub 0-7.
-
- 24 colors at 8 brightneslevels using 32 colors, wow! :)
-
- It might look a bit different, though ;)
-
- |>
- |> Btw, I took a new approach in making a Texture/Gouraud
- |> triangle routine; now it fits almost completely in 256b.
- |> Before it was much larger.
-
- triangle ? only 3 points ? well, 1st outer loop (the one
- mapping horizontal) and 2nd outer (the one "parsing" the
- polygon from top to bottom) should fit into cache.
-
- 3rd outer (recalculation at each polygon-edge the "parser"
- hits doesn't need to be in cache.
- Same goes for 4th outer "kind of init" or 5th outer "clip
- or whatever" :)
-
- |>
- |> -- _
- |> a Stellar programmer _ //
- |> "Amiga - back for the future" \X/
- ------------------------------------------------------------------------
- fischerj@Informatik.TU-Muenchen.DE (Juergen "Rally" Fischer) =:)
-
-